
public class StudentAd {
	String[] names = new String[20];
	
	public void addName(String name){
		for (int i = 0; i < names.length; i++) {
			if(names[i]==null){
				names[i]=name;
				break;
			}
		}
	}
	
	public void showName(){
		for (int i = 0; i < names.length; i++) {
			if(names[i]!=null){
				System.out.println(names[i]);
			}
		}
	}
	
	public static void main(String[] args) {
		StudentAd sa = new StudentAd();
		
		sa.addName("zhangsan");
		sa.addName("lishi");
		
		sa.showName();
	}

}
